home *** CD-ROM | disk | FTP | other *** search
/ MacFormat España 14 / MacFormat n. 14 (Spain) / MacFormat 14.bin / C de cerca / Codewarrior Lite / MacOS Support / Headers / Universal Headers / Dictionary.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-06  |  4.1 KB  |  131 lines

  1. /*
  2.      File:        Dictionary.h
  3.  
  4.      Contains:    Dictionary Manager Interfaces
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __DICTIONARY__
  21. #define __DICTIONARY__
  22.  
  23.  
  24. #ifndef __TYPES__
  25. #include <Types.h>
  26. #endif
  27. /*    #include <ConditionalMacros.h>                                */
  28.  
  29. #ifndef __FILES__
  30. #include <Files.h>
  31. #endif
  32. /*    #include <MixedMode.h>                                        */
  33. /*    #include <OSUtils.h>                                        */
  34. /*        #include <Memory.h>                                        */
  35. /*    #include <Finder.h>                                            */
  36.  
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif
  40.  
  41. #if PRAGMA_ALIGN_SUPPORTED
  42. #pragma options align=mac68k
  43. #endif
  44.  
  45. #if PRAGMA_IMPORT_SUPPORTED
  46. #pragma import on
  47. #endif
  48.  
  49.  
  50. enum {
  51. /* Dictionary data insertion modes */
  52.     kInsert                        = 0,                            /* Only insert the input entry if there is nothing in the dictionary that matches the key. */
  53.     kReplace                    = 1,                            /* Only replace the entries which match the key with the input entry. */
  54.     kInsertOrReplace            = 2                                /* Insert the entry if there is nothing in the dictionary which matches the key. 
  55.                            If there is already matched entries, replace the existing matched entries with the input entry. */
  56. };
  57.  
  58. /* This Was InsertMode */
  59. typedef short DictionaryDataInsertMode;
  60.  
  61.  
  62. enum {
  63. /* Key attribute constants */
  64.     kIsCaseSensitive            = 0x10,                            /* case sensitive = 16        */
  65.     kIsNotDiacriticalSensitive    = 0x20                            /* diac not sensitive = 32    */
  66. };
  67.  
  68. enum {
  69. /* Registered attribute type constants.    */
  70.     kNoun                        = -1,
  71.     kVerb                        = -2,
  72.     kAdjective                    = -3,
  73.     kAdverb                        = -4
  74. };
  75.  
  76. /* This Was AttributeType */
  77. typedef SInt8 DictionaryEntryAttribute;
  78.  
  79. /* Dictionary information record */
  80. struct DictionaryInformation {
  81.     FSSpec                            dictionaryFSSpec;
  82.     SInt32                            numberOfRecords;
  83.     SInt32                            currentGarbageSize;
  84.     ScriptCode                        script;
  85.     SInt16                            maximumKeyLength;
  86.     SInt8                            keyAttributes;
  87.     SInt8                            filler;
  88. };
  89. typedef struct DictionaryInformation DictionaryInformation;
  90.  
  91. struct DictionaryAttributeTable {
  92.     UInt8                            datSize;
  93.     DictionaryEntryAttribute        datTable[1];
  94. };
  95. typedef struct DictionaryAttributeTable DictionaryAttributeTable;
  96.  
  97. typedef DictionaryAttributeTable *DictionaryAttributeTablePtr;
  98.  
  99. extern pascal OSErr InitializeDictionary(const FSSpec *theFsspecPtr, SInt16 maximumKeyLength, SInt8 keyAttributes, ScriptCode script)
  100.  THREEWORDINLINE(0x303C, 0x0500, 0xAA53);
  101. extern pascal OSErr OpenDictionary(const FSSpec *theFsspecPtr, SInt8 accessPermission, SInt32 *dictionaryReference)
  102.  THREEWORDINLINE(0x303C, 0x0501, 0xAA53);
  103. extern pascal OSErr CloseDictionary(SInt32 dictionaryReference)
  104.  THREEWORDINLINE(0x303C, 0x0202, 0xAA53);
  105. extern pascal OSErr InsertRecordToDictionary(SInt32 dictionaryReference, ConstStr255Param key, Handle recordDataHandle, DictionaryDataInsertMode whichMode)
  106.  THREEWORDINLINE(0x303C, 0x0703, 0xAA53);
  107. extern pascal OSErr DeleteRecordFromDictionary(SInt32 dictionaryReference, ConstStr255Param key)
  108.  THREEWORDINLINE(0x303C, 0x0404, 0xAA53);
  109. extern pascal OSErr FindRecordInDictionary(SInt32 dictionaryReference, ConstStr255Param key, DictionaryAttributeTablePtr requestedAttributeTablePointer, Handle recordDataHandle)
  110.  THREEWORDINLINE(0x303C, 0x0805, 0xAA53);
  111. extern pascal OSErr FindRecordByIndexInDictionary(SInt32 dictionaryReference, SInt32 recordIndex, DictionaryAttributeTablePtr requestedAttributeTablePointer, Str255 recordKey, Handle recordDataHandle)
  112.  THREEWORDINLINE(0x303C, 0x0A06, 0xAA53);
  113. extern pascal OSErr GetDictionaryInformation(SInt32 dictionaryReference, DictionaryInformation *theDictionaryInformation)
  114.  THREEWORDINLINE(0x303C, 0x0407, 0xAA53);
  115. extern pascal OSErr CompactDictionary(SInt32 dictionaryReference)
  116.  THREEWORDINLINE(0x303C, 0x0208, 0xAA53);
  117.  
  118. #if PRAGMA_IMPORT_SUPPORTED
  119. #pragma import off
  120. #endif
  121.  
  122. #if PRAGMA_ALIGN_SUPPORTED
  123. #pragma options align=reset
  124. #endif
  125.  
  126. #ifdef __cplusplus
  127. }
  128. #endif
  129.  
  130. #endif /* __DICTIONARY__ */
  131.